package org.intelli.dl.learn.model.common;

import lombok.Data;

/**
 * @author: Michael
 * @date: 2025/4/22
 * @desc:
 */
@Data
public class R {

    private Integer code;
    private String msg;
    private Object data;

    private R ok() {
        R r = new R();
        r.setCode(200);
        return r;
    }

    private R error() {
        R r = new R();
        r.setCode(500);
        return r;
    }

    public static R ok(Integer code, String msg){
        R r = new R();
        r.setCode(200);
        r.setMsg(msg);
        r.setCode(code);
        return r;
    }

    public static R error(Integer code, String msg){
        R r = new R();
        r.setCode(500);
        r.setMsg(msg);
        r.setCode(code);
        return r;
    }
}
